<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
    <script src="jquery-3.1.0.js"></script>
</head>

<body ontouchstart>
    <script type="application/javascript">

$.postJSON = function(url, data, callback) {
    return jQuery.ajax({
        'type': 'POST',
        'url': url,
        'contentType': 'application/json',
        'data': JSON.stringify(data),
        'dataType': 'json',
        'success': callback
    });
};

$(function(){
  var udata = {"username":"abc","content":"231"};
  $.postJSON("/user/login",udata,function(rdata,textStatus,jqXHR){
        console.log(textStatus);
        console.log(rdata);
  });
  $.postJSON("/share/upload",udata,function(rdata,textStatus,jqXHR){
        console.log(textStatus);
        console.log(rdata);
        console.log(typeof(rdata));
  },"json");
});
    </script>
</body>
</html>